﻿using System.Linq.Expressions;

namespace SimpleORM
{
    public class OrderByTranslator : LambdaTranslator
    {
        #region Properties

        public eOrder Order { get; set; }

        #endregion

        #region Methods

        #region Methods - Public

        public override void Translate(Expression expression)
        {
            base.Translate(expression);

            Result = Order == eOrder.Ascending ?
                Result.Ascending(Result) :
                Result.Descending(Result);
        }

        #endregion

        #endregion
    }
}
